﻿/* Autoduel Game
 * CS4911 Senior Design Project
 * Fall 2010 Semester
 * Ian Axelrod, Liz Ha, Andrew Muldowney, Edward Futch
 */

namespace AutoduelClient.GameClient.Network
{
    /// <summary>
    /// Represents a single packet use for client <> server
    /// communications
    /// </summary>
    public class Packet
    {
		#region Fields (2)
		// The message
        private byte[] message;

		// Identifies what received this message
        private MSGORGNS origin;
		#endregion

		#region Properties (2)
		/// <summary>
        /// Gets/Sets the message
        /// </summary>
        public byte[] Message
        {
            get { return message; }
            set { message = value; }
        }
		/// <summary>
        /// Gets/Sets what received this message
        /// </summary>
        public MSGORGNS Origin
        {
            get { return origin; }
            set { origin = value; }
        }
		#endregion

		#region Constructors (1)
		/// <summary>
        /// Instantiates a packet
        /// </summary>
        /// <param name="origin">The listener that received this packet</param>
        /// <param name="message">The payload of this packet</param>
        public Packet(MSGORGNS origin, byte[] message)
        {
            this.origin = origin;
            this.message = message;
        }
		#endregion
    }
}
